import com.ww.yaodao.model.vo.LoginVO;
import com.ww.yaodao.service.UserService;
import com.ww.yaodao.service.impl.UserServiceImpl;
import com.ww.yaodao.util.md5Utils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
 * @Author wanziyan
 * @Date 2023-04-20:50
 */
@SpringBootTest
public class test1 {

    @Test
    public void test() throws Exception {
        System.out.println(md5Utils.getEncryptedPwd("123"));
        System.out.println(md5Utils.validPassword("123",md5Utils.getEncryptedPwd("123")));
        UserServiceImpl userService = new UserServiceImpl();
        LoginVO admin = LoginVO.builder().password("123").username("admin").build();
        Map<String, Object> login = userService.login(admin);
    }
}
